package com.heima.user.controller.v1;

import com.heima.common.dtos.ResponseResult;
import com.heima.model.admin.dtos.AdUserLoginDto;
import com.heima.model.user.dtos.AppLoginDto;
import com.heima.user.service.ApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AppUserLoginController {

    @Autowired
    private ApUserService apUserService;

    /**
     * app端用户登录
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/login/login_auth")
    public ResponseResult login(@Validated @RequestBody AppLoginDto dto){
        return apUserService.login(dto);
    }
}